<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/static/common/taglibs.jsp"%>
<div class="page">
	<div class="pageHeader">
		<form id="pagerForm" onsubmit="return navTabSearch(this);"
			action="${ctx}/jewel" method="post">
			<!--Begin page Search -->
			<input type="hidden" id="numPerPage" name="page.pageSize"
				value="${page.pageSize}" /> <input type="hidden" name="page.pageNo"
				id="pageNum" value="${page.pageNo}" /> <input type="hidden"
				name="page.orderBy" id="orderField" value="${page.orderBy}" /> <input
				type="hidden" name="page.order" id="order" value="${page.order}" />
			<!--End page Search -->
			<div class="searchBar">
				<ul class="searchContent">
					<li style="width: 175px;"><label style="width: 50px;">证书号:</label><input
						type="text" name="filter_LIKE_cardId" style="width: 100px;"
						value="${param['filter_LIKE_cardId']}" size="10" /></li>
						
						<li style="width: 175px;"><label style="width: 50px;">货号:</label><input
						type="text" name="filter_LIKE_num" style="width: 100px;"
						value="${param['filter_LIKE_num']}" size="10" /></li>
						
						<c:if test="${cUser.type==0 }">
							<li style="width: 175px;"><label style="width: 50px;">公司:</label><input
						type="text" name="filter_EQ_company" style="width: 100px;"
						value="${param['filter_EQ_company']}" size="10" /></li>
						</c:if>
				</ul>
				<div class="subBar">
					<ul>
						<li><div class="buttonActive">
								<div class="buttonContent">
									<button type="submit">检索</button>
								</div>
							</div></li>
					</ul>
				</div>
			</div>
		</form>
	</div>

	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
			<c:if test="${cUser.type==1 }">
					<li><a class="add" href="${ctx}/jewel/setDiscount"
						target="dialog" width="400" height="400" rel="d_jewelImport"><span>批量修改批发价格</span>
					</a></li>
					<li><span>当前所加折扣：${cdiscout }</span></li>
			</c:if>
			<c:if test="${cUser.type==0 }">
				<li class="line">line</li>
				<li><a class="add" href="${ctx}/jewel/toImport"
					target="dialog" width="400" height="400" rel="d_jewelImport"><span>导入</span>
				</a></li>
				<li class="line">line</li>
				<li><a class="delete" href="${ctx}/jewel/deletes"
					target="selectedTodo" title="确实要删除这些记录吗?"><span>删除</span> </a></li>
					<li class="line">line</li>
				<li><a class="delete" href="${ctx}/jewel/deleteAll"
					target="ajaxTodo" title="确实要删除这些记录吗?"><span>一键清除</span> </a></li>
				<li><a class="delete" href="${ctx}/jewel/companyInput"
						target="dialog" width="400" height="400" rel="d_jewelImport"><span>根据公司号删除</span>
					</a></li>
				<li><a class="add" href="${ctx}/jewel/downloadJewel"
					 title="导出数据" ><span>导出数据</span> </a></li>
			</c:if>
			</ul>
		</div>
		<div class="panelBar">
			<div class="pages">
				<span>每页显示</span> <select name="numPerPage"
					onchange="navTabPageBreak({numPerPage:this.value})">
					<c:forEach items="${selectPageList}" var="model">
						<option value="${model.key}"
							<c:if test="${model.key==page.pageSize}">selected="selected"</c:if>>${model.value}</option>
					</c:forEach>
				</select> <span>&nbsp;共${page.totalCount}条,共${page.totalPages}页</span>
			</div>
			<div class="pagination" targetType="navTab"
				totalCount="${page.totalCount}" numPerPage="${page.pageSize}"
				pageNumShown="10" currentPage="${page.pageNo}"></div>
		</div>
		<table class="table myTable" width="100%" layouth="148">
			<thead>
				<tr>
				<th width="3%"><input type="checkbox" class="checkboxCtrl"
						group="ids"></th>
					<th align="center">货号</th>
					<th align="center">形状</th>
					<th align="center">重量</th>
					<th align="center">颜色</th>
					<th align="center">净度</th>
					<th align="center">切工</th>
					<th align="center">抛光</th>
					<th align="center">对称</th>
					<th align="center">荧光</th>
					<th align="center">证书</th>
					<th align="center">尺寸</th>
					<th align="center">证书号</th>
					<th align="center">国际报价</th>
					<c:if test="${cUser.type==0 }">
					 <th align="center">公司</th> 
					 </c:if>
					<th align="center">折扣</th>
					 <th align="center">人民币价格</th> 
					<c:if test="${cUser.type==1 }">
					<th align="center">二级折扣</th>
					<th align="center">二级批发价</th>
					</c:if>
					<th align="center">库存</th>
					<!-- <th align="center">奶油色</th>
					<th align="center">咖啡色</th>
					<th align="center">绿色</th> -->
					<c:if test="${cUser.type==0 }">
					<th align="center">操作</th>
					</c:if>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${page.result}" var="jewel" varStatus="index">
					<tr target="sid_id" rel="${jewel.id}">
					    <td><input type="checkbox" value="${jewel.id}" name="ids"></td>
					    <td>${jewel.num }</td>
						<td>${jewel.shape }</td>
						<td>${jewel.weight }</td>
						<td>${jewel.color }</td>
						<td>${jewel.neatness }</td>
						<td>${jewel.cut }</td>
						<td>${jewel.buffing }</td>
						<td>${jewel.symmetry }</td>
						<td>${jewel.fluorescence }</td>
						<td>${jewel.card }</td>
						<td>${jewel.size }</td>
						<td>${jewel.cardId }</td>
						<td>${jewel.internationalPrice }</td>
						<c:if test="${cUser.type==0 }">
						 <td>${jewel.company }</td>
						 </c:if>
						<td><fmt:formatNumber value="${jewel.discount }"   /></td>
						 <td><fmt:formatNumber value="${jewel.priceRMB }" pattern="0" type="number"/></td> 
						<c:if test="${cUser.type==1 }">
						<td><fmt:formatNumber value="${jewel.discount2 }"   /></td>
						<td><fmt:formatNumber value="${jewel.secondPrice }" pattern="0" type="number"/></td>
						</c:if>
						<td>${jewel.holdType }</td>
						<%-- <td>${jewel.hasMilkColor }</td>
						<td>${jewel.hasCoffeeColor }</td>
						<td>${jewel.hasGreenColor }</td> --%>
						<c:if test="${cUser.type==0 }">
						<td><a  href="${ctx}/jewel/delete/${jewel.id}"
									target="ajaxTodo" title="确定要删除吗？">删除</a>
									&nbsp;&nbsp;&nbsp;
									<a 
									href="${ctx}/jewel/input/${jewel.id}" width="800"
									height="500" target="dialog" title="修改">修改</a>
						</td>
						</c:if>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>
</div>
